<template>
	<view class="container">
		<view class="s-from">
			<input type="text" @input="input_title" placeholder="请输入手机号,方便我们联系你"  class="s-input" maxlength="50"/>	
		</view>
		<view class="s-from">
			<textarea class="s-textarea" @input="input_content" placeholder="请输入对该项目的建议,我们会即使更改."/>
		</view>
		
		<view class="s-btn s-btn-color1" v-if="title==''||content==''">确定</view>
		<view class="s-btn s-btn-color2" @tap="set_couple" v-else>确定</view>
	</view>
	
</template>
<script>
	import Couple from './couple-model.js'   
	var couple = new Couple();  
	export default {
		data() {
			return {
				title:'',
				content:''
			}
		},
		methods: {
			//获取手机号
			input_title(e) {
				var that = this;
			    that.title = couple.get_input_val(e);
			},
			//获取code值
			input_content(e){
				var that = this;
				that.content = couple.get_input_val(e);
			},
			//意见反馈
			set_couple(){
				var that = this;
				var title = that.title;
				var content = that.content;
				if(title == ''){
					couple.show_tips({title: '请输入完整的反馈意见！'});
					return;
				}
				if(content == ''){
					couple.show_tips({title: '请输入完整的反馈意见！'});
					return;
				}
				var data = {
					title:title,
					content:content
				};
				couple.set_couple(data,(res)=>{
					if(res.code == 8888){
						couple.switch_tab('../my/my');
					}
				})
			}
		}
	}
</script>

<style>
	@import url("couple.css");
</style>
